package router

import (
	"github.com/gin-gonic/gin"
	. "learngin/controller"
	"learngin/middleware"
)

func InitRouter() *gin.Engine {
	router := gin.Default()

	v1 := router.Group("/v1")
	{
		v1.GET("/index/list", IndexList)
		v1.POST("/login/code", MemberGetMobileCode)
		v1.POST("/account/login", MemberAccountLogin)
		authToken := v1.Group("/api", middleware.CheckMemberLogin())
		{
			authToken.GET("/memberInfo", MemberInfo)
		}
	}
	return router
}
